﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


using MBS.UserControls.CinemaUserControl;

namespace MBS
{
    public partial class Cinema : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                AddCinemaUserControl1.Actionresult.ToString();
                
                
            }

            AddCinemaUserControl1.CinemaAddComplete += new AddCinemaUserControl.CinemaAddHandler(AddCinemaUserControl1_CinemaAddComplete);
            AddCinemaUserControl1.CinemaAddFailed += new AddCinemaUserControl.CinemaAddHandler(AddCinemaUserControl1_CinemaAddFailed);
            
        }

        

        void AddCinemaUserControl1_CinemaAddFailed()
        {
            string x;
            
            if (MBSBLC.BLC.ErrorMessage!=null){
                x = "Cinema Added Failed";
            }
            else {
                x = MBSBLC.BLC.GetCinemaException();
            }
            

            ClientScript.RegisterStartupScript(this.GetType(), "sad", "javascript:showAlert('" + x + "')", true);
        }

        private void AddCinemaUserControl1_CinemaAddComplete()
        {
            string x = "Cinema Added Successfully";
            
            ClientScript.RegisterStartupScript(this.GetType(), "sad", "javascript:showAlert('"+ x +"')", true);
                       
        }

    }
}